﻿@inherits BaseComponent

<div class="kui-steps-form @Model.Direction">
    <Steps Class="@Model.Class" Current="Model.Current">
        @foreach (var item in Model.Items)
        {
            <Step Title="@Language?.GetTitle(item.Title)"
                  Subtitle="@Language?.GetTitle(item.SubTitle)"
                  Description="@Language?.GetTitle(item.Description)" />
        }
    </Steps>
    <div class="kui-steps-content">
        @if (Model.Items != null && Model.Items.Count > 0)
        {
            @Model.Items[Model.Current].Content
        }
    </div>
    <div class="kui-form-action">
        @if (Model.Current > 0)
        {
            <KButton Type="@ButtonType.Primary" Name="@Language["Button.Previous"]" OnClick="OnPrevClickAsync" />
        }
        @if (Model.Current < StepCount - 1)
        {
            <KButton Type="@ButtonType.Primary" Name="@Language["Button.Next"]" OnClick="OnNextClickAsync" />
        }
        @if (Model.Current == StepCount - 1 && !IsView)
        {
            <KButton Type="@ButtonType.Primary" Name="@Language["Button.Finish"]" OnClick="OnCompleteAsync" />
        }
    </div>
</div>